﻿// WARNING!! AUTO GENERATED CODE!!
// MODIFY THE .tt/.t4 FILE FOR PERMANENT CHANGE

using System;
using System.Collections.Generic;
using DXBase;
using DXBase.Structs;

namespace DXBase
{
	// unfortunately generics and pointers don't mix
	// these methods provide a workaround

	#region PointerInt32 : Pointer<int>

	/// <summary>
	/// A list item with an underlying native pointer as backing storage.
	/// Beware this item is unsafe, no bounds checking on many methods
	/// </summary>
	public unsafe class PointerInt32 : Pointer<int>
	{
		public PointerInt32() {}
		public PointerInt32(IPointer p) : base(p) {}

		// convenient method
		new public int* GetPointer() { return (int*)base.GetPointer(); }

		// === required
		public override int this[int index]
		{
			get { return GetPointer()[index]; }
			set { GetPointer()[index] = value; }
		}

		// === performance improvement
		protected override void CopyRangeAt(int index, ICollection<int> items)
		{
			var p = GetPointer();
			p += index;
			foreach (var value in items)
				*p++ = value;
		}

		protected override void CopyToImpl(int[] array, int arrayIndex, int N)
		{
			var p = GetPointer();
			p += arrayIndex;
			for (int i = 0; i < N; i++)
				array[i] = *p++;
		}

		public override int IndexOf(int item)
		{
			var p = GetPointer();
			for (int i = 0, N = Count; i < N; i++)
				if (Equals(*p++, item))
					return i;
			return -1;
		}
	}

	#endregion

	#region PointerInt16 : Pointer<short>

	/// <summary>
	/// A list item with an underlying native pointer as backing storage.
	/// Beware this item is unsafe, no bounds checking on many methods
	/// </summary>
	public unsafe class PointerInt16 : Pointer<short>
	{
		public PointerInt16() {}
		public PointerInt16(IPointer p) : base(p) {}

		// convenient method
		new public short* GetPointer() { return (short*)base.GetPointer(); }

		// === required
		public override short this[int index]
		{
			get { return GetPointer()[index]; }
			set { GetPointer()[index] = value; }
		}

		// === performance improvement
		protected override void CopyRangeAt(int index, ICollection<short> items)
		{
			var p = GetPointer();
			p += index;
			foreach (var value in items)
				*p++ = value;
		}

		protected override void CopyToImpl(short[] array, int arrayIndex, int N)
		{
			var p = GetPointer();
			p += arrayIndex;
			for (int i = 0; i < N; i++)
				array[i] = *p++;
		}

		public override int IndexOf(short item)
		{
			var p = GetPointer();
			for (int i = 0, N = Count; i < N; i++)
				if (Equals(*p++, item))
					return i;
			return -1;
		}
	}

	#endregion

	#region PointerUInt32 : Pointer<uint>

	/// <summary>
	/// A list item with an underlying native pointer as backing storage.
	/// Beware this item is unsafe, no bounds checking on many methods
	/// </summary>
	public unsafe class PointerUInt32 : Pointer<uint>
	{
		public PointerUInt32() {}
		public PointerUInt32(IPointer p) : base(p) {}

		// convenient method
		new public uint* GetPointer() { return (uint*)base.GetPointer(); }

		// === required
		public override uint this[int index]
		{
			get { return GetPointer()[index]; }
			set { GetPointer()[index] = value; }
		}

		// === performance improvement
		protected override void CopyRangeAt(int index, ICollection<uint> items)
		{
			var p = GetPointer();
			p += index;
			foreach (var value in items)
				*p++ = value;
		}

		protected override void CopyToImpl(uint[] array, int arrayIndex, int N)
		{
			var p = GetPointer();
			p += arrayIndex;
			for (int i = 0; i < N; i++)
				array[i] = *p++;
		}

		public override int IndexOf(uint item)
		{
			var p = GetPointer();
			for (int i = 0, N = Count; i < N; i++)
				if (Equals(*p++, item))
					return i;
			return -1;
		}
	}

	#endregion

	#region PointerUInt16 : Pointer<ushort>

	/// <summary>
	/// A list item with an underlying native pointer as backing storage.
	/// Beware this item is unsafe, no bounds checking on many methods
	/// </summary>
	public unsafe class PointerUInt16 : Pointer<ushort>
	{
		public PointerUInt16() {}
		public PointerUInt16(IPointer p) : base(p) {}

		// convenient method
		new public ushort* GetPointer() { return (ushort*)base.GetPointer(); }

		// === required
		public override ushort this[int index]
		{
			get { return GetPointer()[index]; }
			set { GetPointer()[index] = value; }
		}

		// === performance improvement
		protected override void CopyRangeAt(int index, ICollection<ushort> items)
		{
			var p = GetPointer();
			p += index;
			foreach (var value in items)
				*p++ = value;
		}

		protected override void CopyToImpl(ushort[] array, int arrayIndex, int N)
		{
			var p = GetPointer();
			p += arrayIndex;
			for (int i = 0; i < N; i++)
				array[i] = *p++;
		}

		public override int IndexOf(ushort item)
		{
			var p = GetPointer();
			for (int i = 0, N = Count; i < N; i++)
				if (Equals(*p++, item))
					return i;
			return -1;
		}
	}

	#endregion

	#region PointerByte : Pointer<byte>

	/// <summary>
	/// A list item with an underlying native pointer as backing storage.
	/// Beware this item is unsafe, no bounds checking on many methods
	/// </summary>
	public unsafe class PointerByte : Pointer<byte>
	{
		public PointerByte() {}
		public PointerByte(IPointer p) : base(p) {}

		// convenient method
		new public byte* GetPointer() { return (byte*)base.GetPointer(); }

		// === required
		public override byte this[int index]
		{
			get { return GetPointer()[index]; }
			set { GetPointer()[index] = value; }
		}

		// === performance improvement
		protected override void CopyRangeAt(int index, ICollection<byte> items)
		{
			var p = GetPointer();
			p += index;
			foreach (var value in items)
				*p++ = value;
		}

		protected override void CopyToImpl(byte[] array, int arrayIndex, int N)
		{
			var p = GetPointer();
			p += arrayIndex;
			for (int i = 0; i < N; i++)
				array[i] = *p++;
		}

		public override int IndexOf(byte item)
		{
			var p = GetPointer();
			for (int i = 0, N = Count; i < N; i++)
				if (Equals(*p++, item))
					return i;
			return -1;
		}
	}

	#endregion

	#region PointerSingle : Pointer<float>

	/// <summary>
	/// A list item with an underlying native pointer as backing storage.
	/// Beware this item is unsafe, no bounds checking on many methods
	/// </summary>
	public unsafe class PointerSingle : Pointer<float>
	{
		public PointerSingle() {}
		public PointerSingle(IPointer p) : base(p) {}

		// convenient method
		new public float* GetPointer() { return (float*)base.GetPointer(); }

		// === required
		public override float this[int index]
		{
			get { return GetPointer()[index]; }
			set { GetPointer()[index] = value; }
		}

		// === performance improvement
		protected override void CopyRangeAt(int index, ICollection<float> items)
		{
			var p = GetPointer();
			p += index;
			foreach (var value in items)
				*p++ = value;
		}

		protected override void CopyToImpl(float[] array, int arrayIndex, int N)
		{
			var p = GetPointer();
			p += arrayIndex;
			for (int i = 0; i < N; i++)
				array[i] = *p++;
		}

		public override int IndexOf(float item)
		{
			var p = GetPointer();
			for (int i = 0, N = Count; i < N; i++)
				if (Equals(*p++, item))
					return i;
			return -1;
		}
	}

	#endregion

	#region PointerDouble : Pointer<double>

	/// <summary>
	/// A list item with an underlying native pointer as backing storage.
	/// Beware this item is unsafe, no bounds checking on many methods
	/// </summary>
	public unsafe class PointerDouble : Pointer<double>
	{
		public PointerDouble() {}
		public PointerDouble(IPointer p) : base(p) {}

		// convenient method
		new public double* GetPointer() { return (double*)base.GetPointer(); }

		// === required
		public override double this[int index]
		{
			get { return GetPointer()[index]; }
			set { GetPointer()[index] = value; }
		}

		// === performance improvement
		protected override void CopyRangeAt(int index, ICollection<double> items)
		{
			var p = GetPointer();
			p += index;
			foreach (var value in items)
				*p++ = value;
		}

		protected override void CopyToImpl(double[] array, int arrayIndex, int N)
		{
			var p = GetPointer();
			p += arrayIndex;
			for (int i = 0; i < N; i++)
				array[i] = *p++;
		}

		public override int IndexOf(double item)
		{
			var p = GetPointer();
			for (int i = 0, N = Count; i < N; i++)
				if (Equals(*p++, item))
					return i;
			return -1;
		}
	}

	#endregion

	#region PointerBasicVertex : Pointer<BasicVertex>

	/// <summary>
	/// A list item with an underlying native pointer as backing storage.
	/// Beware this item is unsafe, no bounds checking on many methods
	/// </summary>
	public unsafe class PointerBasicVertex : Pointer<BasicVertex>
	{
		public PointerBasicVertex() {}
		public PointerBasicVertex(IPointer p) : base(p) {}

		// convenient method
		new public BasicVertex* GetPointer() { return (BasicVertex*)base.GetPointer(); }

		// === required
		public override BasicVertex this[int index]
		{
			get { return GetPointer()[index]; }
			set { GetPointer()[index] = value; }
		}

		// === performance improvement
		protected override void CopyRangeAt(int index, ICollection<BasicVertex> items)
		{
			var p = GetPointer();
			p += index;
			foreach (var value in items)
				*p++ = value;
		}

		protected override void CopyToImpl(BasicVertex[] array, int arrayIndex, int N)
		{
			var p = GetPointer();
			p += arrayIndex;
			for (int i = 0; i < N; i++)
				array[i] = *p++;
		}

		public override int IndexOf(BasicVertex item)
		{
			var p = GetPointer();
			for (int i = 0, N = Count; i < N; i++)
				if (Equals(*p++, item))
					return i;
			return -1;
		}
	}

	#endregion

	#region PointerPerObjectData : Pointer<PerObjectData>

	/// <summary>
	/// A list item with an underlying native pointer as backing storage.
	/// Beware this item is unsafe, no bounds checking on many methods
	/// </summary>
	public unsafe class PointerPerObjectData : Pointer<PerObjectData>
	{
		public PointerPerObjectData() {}
		public PointerPerObjectData(IPointer p) : base(p) {}

		// convenient method
		new public PerObjectData* GetPointer() { return (PerObjectData*)base.GetPointer(); }

		// === required
		public override PerObjectData this[int index]
		{
			get { return GetPointer()[index]; }
			set { GetPointer()[index] = value; }
		}

		// === performance improvement
		protected override void CopyRangeAt(int index, ICollection<PerObjectData> items)
		{
			var p = GetPointer();
			p += index;
			foreach (var value in items)
				*p++ = value;
		}

		protected override void CopyToImpl(PerObjectData[] array, int arrayIndex, int N)
		{
			var p = GetPointer();
			p += arrayIndex;
			for (int i = 0; i < N; i++)
				array[i] = *p++;
		}

		public override int IndexOf(PerObjectData item)
		{
			var p = GetPointer();
			for (int i = 0, N = Count; i < N; i++)
				if (Equals(*p++, item))
					return i;
			return -1;
		}
	}

	#endregion

	#region PointerPerFrameData : Pointer<PerFrameData>

	/// <summary>
	/// A list item with an underlying native pointer as backing storage.
	/// Beware this item is unsafe, no bounds checking on many methods
	/// </summary>
	public unsafe class PointerPerFrameData : Pointer<PerFrameData>
	{
		public PointerPerFrameData() {}
		public PointerPerFrameData(IPointer p) : base(p) {}

		// convenient method
		new public PerFrameData* GetPointer() { return (PerFrameData*)base.GetPointer(); }

		// === required
		public override PerFrameData this[int index]
		{
			get { return GetPointer()[index]; }
			set { GetPointer()[index] = value; }
		}

		// === performance improvement
		protected override void CopyRangeAt(int index, ICollection<PerFrameData> items)
		{
			var p = GetPointer();
			p += index;
			foreach (var value in items)
				*p++ = value;
		}

		protected override void CopyToImpl(PerFrameData[] array, int arrayIndex, int N)
		{
			var p = GetPointer();
			p += arrayIndex;
			for (int i = 0; i < N; i++)
				array[i] = *p++;
		}

		public override int IndexOf(PerFrameData item)
		{
			var p = GetPointer();
			for (int i = 0, N = Count; i < N; i++)
				if (Equals(*p++, item))
					return i;
			return -1;
		}
	}

	#endregion

	#region PointerDirectionalLight : Pointer<DirectionalLight>

	/// <summary>
	/// A list item with an underlying native pointer as backing storage.
	/// Beware this item is unsafe, no bounds checking on many methods
	/// </summary>
	public unsafe class PointerDirectionalLight : Pointer<DirectionalLight>
	{
		public PointerDirectionalLight() {}
		public PointerDirectionalLight(IPointer p) : base(p) {}

		// convenient method
		new public DirectionalLight* GetPointer() { return (DirectionalLight*)base.GetPointer(); }

		// === required
		public override DirectionalLight this[int index]
		{
			get { return GetPointer()[index]; }
			set { GetPointer()[index] = value; }
		}

		// === performance improvement
		protected override void CopyRangeAt(int index, ICollection<DirectionalLight> items)
		{
			var p = GetPointer();
			p += index;
			foreach (var value in items)
				*p++ = value;
		}

		protected override void CopyToImpl(DirectionalLight[] array, int arrayIndex, int N)
		{
			var p = GetPointer();
			p += arrayIndex;
			for (int i = 0; i < N; i++)
				array[i] = *p++;
		}

		public override int IndexOf(DirectionalLight item)
		{
			var p = GetPointer();
			for (int i = 0, N = Count; i < N; i++)
				if (Equals(*p++, item))
					return i;
			return -1;
		}
	}

	#endregion

	#region PointerPointLight : Pointer<PointLight>

	/// <summary>
	/// A list item with an underlying native pointer as backing storage.
	/// Beware this item is unsafe, no bounds checking on many methods
	/// </summary>
	public unsafe class PointerPointLight : Pointer<PointLight>
	{
		public PointerPointLight() {}
		public PointerPointLight(IPointer p) : base(p) {}

		// convenient method
		new public PointLight* GetPointer() { return (PointLight*)base.GetPointer(); }

		// === required
		public override PointLight this[int index]
		{
			get { return GetPointer()[index]; }
			set { GetPointer()[index] = value; }
		}

		// === performance improvement
		protected override void CopyRangeAt(int index, ICollection<PointLight> items)
		{
			var p = GetPointer();
			p += index;
			foreach (var value in items)
				*p++ = value;
		}

		protected override void CopyToImpl(PointLight[] array, int arrayIndex, int N)
		{
			var p = GetPointer();
			p += arrayIndex;
			for (int i = 0; i < N; i++)
				array[i] = *p++;
		}

		public override int IndexOf(PointLight item)
		{
			var p = GetPointer();
			for (int i = 0, N = Count; i < N; i++)
				if (Equals(*p++, item))
					return i;
			return -1;
		}
	}

	#endregion

	#region PointerSpotLight : Pointer<SpotLight>

	/// <summary>
	/// A list item with an underlying native pointer as backing storage.
	/// Beware this item is unsafe, no bounds checking on many methods
	/// </summary>
	public unsafe class PointerSpotLight : Pointer<SpotLight>
	{
		public PointerSpotLight() {}
		public PointerSpotLight(IPointer p) : base(p) {}

		// convenient method
		new public SpotLight* GetPointer() { return (SpotLight*)base.GetPointer(); }

		// === required
		public override SpotLight this[int index]
		{
			get { return GetPointer()[index]; }
			set { GetPointer()[index] = value; }
		}

		// === performance improvement
		protected override void CopyRangeAt(int index, ICollection<SpotLight> items)
		{
			var p = GetPointer();
			p += index;
			foreach (var value in items)
				*p++ = value;
		}

		protected override void CopyToImpl(SpotLight[] array, int arrayIndex, int N)
		{
			var p = GetPointer();
			p += arrayIndex;
			for (int i = 0; i < N; i++)
				array[i] = *p++;
		}

		public override int IndexOf(SpotLight item)
		{
			var p = GetPointer();
			for (int i = 0, N = Count; i < N; i++)
				if (Equals(*p++, item))
					return i;
			return -1;
		}
	}

	#endregion

	#region PointerModelVertex : Pointer<ModelVertex>

	/// <summary>
	/// A list item with an underlying native pointer as backing storage.
	/// Beware this item is unsafe, no bounds checking on many methods
	/// </summary>
	public unsafe class PointerModelVertex : Pointer<ModelVertex>
	{
		public PointerModelVertex() {}
		public PointerModelVertex(IPointer p) : base(p) {}

		// convenient method
		new public ModelVertex* GetPointer() { return (ModelVertex*)base.GetPointer(); }

		// === required
		public override ModelVertex this[int index]
		{
			get { return GetPointer()[index]; }
			set { GetPointer()[index] = value; }
		}

		// === performance improvement
		protected override void CopyRangeAt(int index, ICollection<ModelVertex> items)
		{
			var p = GetPointer();
			p += index;
			foreach (var value in items)
				*p++ = value;
		}

		protected override void CopyToImpl(ModelVertex[] array, int arrayIndex, int N)
		{
			var p = GetPointer();
			p += arrayIndex;
			for (int i = 0; i < N; i++)
				array[i] = *p++;
		}

		public override int IndexOf(ModelVertex item)
		{
			var p = GetPointer();
			for (int i = 0, N = Count; i < N; i++)
				if (Equals(*p++, item))
					return i;
			return -1;
		}
	}

	#endregion
}

